Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default discovery service #995

Merged
merged 2 commits into from
Jun 5, 2019

Conversation

nkvoll
Copy link
Member

@nkvoll nkvoll commented Jun 5, 2019

Leaves remote clusters in a working state by reconciling a {remote}-es-remote-cluster-seed Service in the remote namespace so we have something to give to Elasticsearch through seed_hosts.

Since we cannot set owners across namespaces, and this same service could be used by multiple remote clusters, we have to deal with its lifecycle a bit differently:

  1. All remote cluster resources reconcile this service to ensure it exists.
  2. When a RemoteCluster resource is deleted, a finalizer deletes the Service to clean up.
  3. The remote cluster controller watches services and reconciles all related remote cluster resources upon changes (including deletion) to the services. This causes the service to be deleted when it /might/ not be required anymore, and re-created immediately if it is still required.

It is no longer required for discovery, which is now file based.
operators/pkg/controller/remotecluster/finalizers_test.go Outdated Show resolved Hide resolved
operators/pkg/controller/remotecluster/watches.go Outdated Show resolved Hide resolved
}); err != nil {
return err
}

return nil
}

// reconcileAllRemoteClusters creates a reconcile request for each currently existing remote cluster resource.
func reconcileAllRemoteClusters(c k8s.Client) handler.ToRequestsFunc {
func allRemoteClustersWithMatchingSeedServiceMapper(c k8s.Client) handler.Mapper {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a long function name!

@nkvoll nkvoll force-pushed the remove-default-discovery-service branch from a3934d6 to 3c8d0e6 Compare June 5, 2019 11:34
@nkvoll nkvoll force-pushed the remove-default-discovery-service branch from 3c8d0e6 to 33123a9 Compare June 5, 2019 11:56
@nkvoll nkvoll merged commit 21ccf9b into elastic:master Jun 5, 2019
@nkvoll nkvoll deleted the remove-default-discovery-service branch June 5, 2019 12:30
@pebrc pebrc added >enhancement Enhancement of existing functionality v0.9.0 labels Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v0.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants